(function(){
  var button = document.getElementById("pages").children[1].children[0]
  button.addEventListener("click", function(){
    var date = new Date();
    var strDate = date.getFullYear() + "-" +
                  (date.getMonth() + 1) + "-" +
                  date.getDate();
    var strTime = date.getHours() + ":" +
                  date.getMinutes() + ":" +
                  date.getSeconds();
    var item = {
      id: 0,
      name: "woody",
      date: strDate,
      time: strTime
    }
    chrome.extension.sendMessage({"action": "click", "data": item},
      function(response){
      });
  })
})();
